package com.franzliszt.OrderOnline.fragment;

import android.media.Image;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.LinearLayoutManager;

import com.franzliszt.hospitalnumberingsystem.R;


import java.util.ArrayList;
import java.util.List;

public class Content extends Fragment {
    private View view;
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate( R.layout.content_item,container,false );
        return view;
    }


    public void Refresh(int GoodsIMG, String Content, String Specs, double Price, int AddIMG, int SubIMG, int Number, String Type) {
        View visibilityLayout = view.findViewById(R.id.layout);
        visibilityLayout.setVisibility(View.VISIBLE);//显示
        TextView medicineContent = view.findViewById( R.id.medicineName );
        TextView medicineSpes = view.findViewById( R.id.medicineSpecs );
        TextView medicinePrice = view.findViewById( R.id.medicinePrice );
        TextView medicineNumber = view.findViewById( R.id.Number);
        ImageView medicineImg = view.findViewById( R.id.medicineIMG );
        ImageView Add = view.findViewById( R.id.Add );
        ImageView Sub = view.findViewById( R.id.Sub );
        medicineContent.setText( Content );
        medicinePrice.setText( Price+"" );
        medicineSpes.setText( Specs );
        medicineNumber.setText( Number+"" );
        medicineImg.setImageResource( GoodsIMG );
        Add.setImageResource( AddIMG );
        Sub.setImageResource( SubIMG );
    }
}
